<?php

namespace ticket\modules\backend\models;

use Yii;

/**
 * This is the model class for table "kly_channel".
 *
 * @property int $id
 * @property string $title 名称
 * @property string $channel 渠道号
 * @property string $key key
 * @property string $remake
 */
class KlyChannel extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'kly_channel';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['title', 'channel', 'key'], 'required'],
            [['title', 'key', 'remake'], 'string', 'max' => 255],
            [['channel'], 'string', 'max' => 64],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'title' => 'Title',
            'channel' => 'Channel',
            'key' => 'Key',
            'remake' => 'Remake',
        ];
    }

    public function getList()
    {
        $list = self::find()->asArray()->all();
        return $list;
    }
}
